﻿eventModule.controller("rankingController", function ($scope, $location, EventService) {
    EventService.getVacancys().then(function (vacancys) { $scope.vacancys = vacancys }, function ()
    { alert('Error Occured.') });
    $scope.cert = { recommandation: 10, experience: 20, education: 10, eligibility: 5, location: 5, age: 5, certifications: 5, skills: 30, projects: 10 };
    $scope.total = $scope.cert.recommandation +
                    $scope.cert.experience +
                    $scope.cert.education +
                    $scope.cert.eligibility +
                    $scope.cert.location +
                    $scope.cert.age +
                    $scope.cert.certifications +
                    $scope.cert.skills +
                    $scope.cert.projects;



    $scope.rank = function (cert) {
        EventService.rankApplicants(cert).then(function (data) { $scope.candidates = data; }, function ()
        { alert('Please select vacancy!') });
    };


});
